Integrand size = 36, antiderivative size = 215 \[ \int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx=\frac {2 B (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}}-\frac {2 (i A+B) \operatorname {AppellF1}\left (\frac {1}{2},1-n,1,\frac {3}{2},-i \tan (c+d x),i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d \sqrt {\cot (c+d x)}}+\frac {2 (2 B n+i A (1+2 n)) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},1-n,\frac {3}{2},-i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}} \]
[Out]
Time = 0.67 (sec) , antiderivative size = 215, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {4326, 3678, 3682, 3645, 129, 441, 440, 3680, 68, 66} \[ \int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx=-\frac {2 (B+i A) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n \operatorname {AppellF1}\left (\frac {1}{2},1-n,1,\frac {3}{2},-i \tan (c+d x),i \tan (c+d x)\right )}{d \sqrt {\cot (c+d x)}}+\frac {2 (2 B n+i A (2 n+1)) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n \operatorname {Hypergeometric2F1}\left (\frac {1}{2},1-n,\frac {3}{2},-i \tan (c+d x)\right )}{d (2 n+1) \sqrt {\cot (c+d x)}}+\frac {2 B (a+i a \tan (c+d x))^n}{d (2 n+1) \sqrt {\cot (c+d x)}} \]
[In]
[Out]
Rule 66
Rule 68
Rule 129
Rule 440
Rule 441
Rule 3645
Rule 3678
Rule 3680
Rule 3682
Rule 4326
Rubi steps \begin{align*} \text {integral}& = \left (\sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \int \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \\ & = \frac {2 B (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}}+\frac {\left (2 \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \int \frac {(a+i a \tan (c+d x))^n \left (-\frac {a B}{2}+\frac {1}{2} a (A+2 A n-2 i B n) \tan (c+d x)\right )}{\sqrt {\tan (c+d x)}} \, dx}{a (1+2 n)} \\ & = \frac {2 B (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}}-\left ((i A+B) \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \int \frac {(a+i a \tan (c+d x))^n}{\sqrt {\tan (c+d x)}} \, dx+\frac {\left ((2 B n+i A (1+2 n)) \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \int \frac {(a-i a \tan (c+d x)) (a+i a \tan (c+d x))^n}{\sqrt {\tan (c+d x)}} \, dx}{a (1+2 n)} \\ & = \frac {2 B (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}}-\frac {\left (i a^2 (i A+B) \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \text {Subst}\left (\int \frac {(a+x)^{-1+n}}{\sqrt {-\frac {i x}{a}} \left (-a^2+a x\right )} \, dx,x,i a \tan (c+d x)\right )}{d}+\frac {\left (a (2 B n+i A (1+2 n)) \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \text {Subst}\left (\int \frac {(a+i a x)^{-1+n}}{\sqrt {x}} \, dx,x,\tan (c+d x)\right )}{d (1+2 n)} \\ & = \frac {2 B (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}}+\frac {\left (2 a^3 (i A+B) \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \text {Subst}\left (\int \frac {\left (a+i a x^2\right )^{-1+n}}{-a^2+i a^2 x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{d}+\frac {\left ((2 B n+i A (1+2 n)) \sqrt {\cot (c+d x)} (1+i \tan (c+d x))^{-n} \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n\right ) \text {Subst}\left (\int \frac {(1+i x)^{-1+n}}{\sqrt {x}} \, dx,x,\tan (c+d x)\right )}{d (1+2 n)} \\ & = \frac {2 B (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}}+\frac {2 (2 B n+i A (1+2 n)) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},1-n,\frac {3}{2},-i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}}+\frac {\left (2 a^2 (i A+B) \sqrt {\cot (c+d x)} (1+i \tan (c+d x))^{-n} \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n\right ) \text {Subst}\left (\int \frac {\left (1+i x^2\right )^{-1+n}}{-a^2+i a^2 x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{d} \\ & = \frac {2 B (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}}-\frac {2 (i A+B) \operatorname {AppellF1}\left (\frac {1}{2},1-n,1,\frac {3}{2},-i \tan (c+d x),i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d \sqrt {\cot (c+d x)}}+\frac {2 (2 B n+i A (1+2 n)) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},1-n,\frac {3}{2},-i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d (1+2 n) \sqrt {\cot (c+d x)}} \\ \end{align*}
\[ \int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx=\int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx \]
[In]
[Out]
\[\int \frac {\left (a +i a \tan \left (d x +c \right )\right )^{n} \left (A +B \tan \left (d x +c \right )\right )}{\sqrt {\cot \left (d x +c \right )}}d x\]
[In]
[Out]
\[ \int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx=\int { \frac {{\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n}}{\sqrt {\cot \left (d x + c\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx=\int \frac {\left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n} \left (A + B \tan {\left (c + d x \right )}\right )}{\sqrt {\cot {\left (c + d x \right )}}}\, dx \]
[In]
[Out]
\[ \int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx=\int { \frac {{\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n}}{\sqrt {\cot \left (d x + c\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx=\int { \frac {{\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n}}{\sqrt {\cot \left (d x + c\right )}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx=\int \frac {\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^n}{\sqrt {\mathrm {cot}\left (c+d\,x\right )}} \,d x \]
[In]
[Out]